﻿using System.Collections;
using System.Drawing;

namespace TestAnimation
{
    class Asteroid:ScreenObject
    {
        public Asteroid(int width):this(width,new Vector(Helper.GetRnd(Globals.maxX), Helper.GetRnd(Globals.maxY)))
        { }
        public Asteroid(int width, Vector pos)
        {
            position = pos;
            ObjectOrientation = Helper.GetRnd(360);
            CourseOrientation = Helper.GetRnd(360);
            rotationSpeed = Helper.GetRnd(3) + 1;
            speed = Helper.GetRnd(18*800/width) + 5;
            SetVelocity();
            points = new ArrayList(4);
            transformedPoints = new ArrayList(4);

            objectWidth = width;
            objectHeight = width;
            objectSize = objectHeight;

            int halfW = objectWidth / 2;
            points.Add(new Point(-halfW, halfW));
            points.Add(new Point(-halfW, -halfW));
            points.Add(new Point(halfW, -halfW));
            points.Add(new Point(halfW, halfW));
        }
        public override void Move()
        {
            ObjectOrientation += rotationSpeed;
            base.Move();
        }
    }
}
